﻿/*4. Write a program that finds the maximal sequence of equal elements in an array.
		Example: {2, 1, 1, 2, 3, 3, 2, 2, 2, 1}  {2, 2, 2}. */

using System;

    class MaximalSequence
    {
        static void Main()
        {
            int n = int.Parse(Console.ReadLine());
            int[] sequence=new int[n];
            int maxSequence = 0;
            int counter = 1;

            for (int i = 0; i < sequence.Length; i++)
			{
                Console.Write("Please enter element: ");
                sequence[i] = int.Parse(Console.ReadLine());
                Console.WriteLine();
			}
            for (int i = 0; i < sequence.Length-1; i++)
            {
                if (sequence[i]==sequence[i+1])
                {
                    counter++;
                }
                else
                {
                    counter = 1;
                }
                if (counter>maxSequence)
                {
                    maxSequence = counter;
                }
            }
            Console.WriteLine("Max consecutive elements are: {0}",maxSequence);
        }
    }

